package com.lzj;

import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class MovieUtil {

    public static void main(String[] args) throws IOException {
        //读取学生信息
        List<String> movieList = FileUtils.readLines(new File(MovieUtil.class.getResource("/movie.txt").getPath()));

        for (int i = 5000; i < movieList.size(); i++) {

            String movie = movieList.get(i);
            Pattern pattern = Pattern.compile("\\\".*?\\\"");
            Matcher matcher = pattern.matcher(movie);
            while (matcher.find()) {
                String result01 = matcher.group();
                String result02 = result01.replace(",", "-");

                movie = movie.replaceAll(result01, result02);
            }

            System.out.println(movie);
        }
    }
}
